package com.Interface.TestIO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class test4 {
    public static void main(String[] args) throws Exception {
        String path1 = "D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test1.txt";
        String path2 = "D:\\JAVA\\schoolSystem\\src\\com\\Interface\\TestIO\\file\\test2.txt";

        InputStream inputStream = new FileInputStream(path1);
        OutputStream outputStream = new FileOutputStream(path2);


        int read = 0;
        byte[] bytes = new byte[inputStream.available()];
        int bytesRead;
        while (inputStream.read(bytes) != -1){
            outputStream.write(bytes);
        }

        inputStream.close();
        outputStream.close();
    }
}
